@extends('admin::layouts.master')
@section('content')
    @component('components.tabs',['title' => "栏目管理"])
        @slot('nav')
            <li class="nav-item"><a class="nav-link" href="/article/category">栏目列表</a>
            </li>
            <li class="nav-item"><a class="nav-link active" href="/article/category/create">添加栏目</a></li>
        @endslot
        @slot('body')
            <form action="/article/category" method="post">
                @csrf
                <div class="panel-body">

                    <div class="form-group">
                        <label>栏目名称</label>
                        <input type="text" name="name" value="{{old('name')}}" class="form-control form-control-sm">
                    </div>
                    <div class="form-group">
                        <label>父级</label>
                        <select name="pid" class="form-control form-control-xs">
                            <option value="0">顶级栏目</option>
                            @foreach($categories as $category)
                                <option value="{{$category['id']}}">{!!$category['_name'] !!}</option>
                            @endforeach
                        </select>
                    </div>
                    <p class="text-left">
                        <button type="submit" class="btn btn-space btn-primary">添加</button>
                    </p>
                </div>
            </form>
        @endslot
    @endcomponent
@endsection
